import { useApprovalProvide } from '..';

/**
 * 审批撤回
 * 只有提交人角色 & 审批流程未结束 展示，(如果用户是 提交人&审批人，则不展示)
 * @returns
 */
export const useRevoke = () => {
  const { isSubmitUser, isApprovalUser, approvalConclusion } = useApprovalProvide();

  // 是否展示撤回模块
  const isRevokeMode = computed(() => {
    // 审批流程是否已经结束
    const isApprovalClose = !!approvalConclusion.value && approvalConclusion.value !== 'PROCESSING';
    return isSubmitUser.value && !isApprovalUser.value && !isApprovalClose;
  });
  const handleRevoke = () => {};
  return {
    isRevokeMode,
    handleRevoke
  };
};
